SPB Git forge
38commits 1branches 0releases
338.7 MBsize
maindefault branch
6 h agolast push
HTML 53.9% TypeScript 44.5% JavaScript 0.6% SQL 0.5%
1.3 KB · 29 lines tsx
Raw Blame History
1import { api } from "@/lib/api";2import { countryName, fmtInt, fmtMw } from "@/lib/format";3import { OPERATOR_KIND_LABEL } from "@/lib/labels";4import { OG_CONTENT_TYPE, OG_SIZE, renderOg } from "@/lib/og-template";56export const alt = "Operator profile on DataCenterIndex";7export const size = OG_SIZE;8export const contentType = OG_CONTENT_TYPE;9export const revalidate = 3600;1011export default async function Image({ params }: { params: Promise<{ slug: string }> }) {12  const { slug } = await params;13  const r = await api.operator(slug);14  if (!r.ok) return renderOg({ eyebrow: "Operator", title: slug.replace(/-/g, " "), subtitle: "Facilities, footprint, capacity and change history." });15  const o = r.data;16  const sub = [o.kind ? OPERATOR_KIND_LABEL[o.kind] : null, o.hqCountryIso2 ? `HQ ${countryName(o.hqCountryIso2)}` : null].filter(Boolean).join(" · ");17  return renderOg({18    eyebrow: "Operator",19    title: o.name,20    subtitle: sub || "Data center operator",21    stats: [22      { label: "Facilities", value: fmtInt(o.facilityCount) },23      { label: "Countries", value: fmtInt(o.countryCount) },24      { label: "Known MW", value: o.knownMw ? fmtMw(o.knownMw) : "—" },25      { label: "Pipeline", value: o.plannedMw ? `≈ ${fmtMw(o.plannedMw)}` : "—" },26    ],27  });28}29